#pragma once

#include <QWidget>
#include <QSystemTrayIcon>
#include <QtWidgets>

#include "ui_CTrayIconWrapper.h"



class QMenu;

class QAction;

class CTrayIconWrapper : public QWidget
{
	Q_OBJECT
private slots:
	void OnTrayActivated(QSystemTrayIcon::ActivationReason reason);
	void OnShowMainWindow();
	void OnQuitAction();
public:
	explicit CTrayIconWrapper(QWidget *parent = Q_NULLPTR);
	~CTrayIconWrapper();
	bool CreateSystemTrayIcon(QStringView hoverMsg);
private:
	bool CreateAction();
	bool CreateContextMenu();
private:
	Ui::CTrayIconWrapper ui;
	QMenu* m_context_menu;
	QAction* m_main_action;
	QAction* m_quit_action;
	QSystemTrayIcon* m_tray;
	QWidget* m_main_window;
	QString m_main_title;
};
